//
//  CREmoticonManager.h
//  TestPrj
//
//  Created by 朱铅峰 on 2020/8/4.
//  Copyright © 2020 Xing. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef enum : NSUInteger {
    CREmoticonTypeFile = 0,
    CREmoticonTypeUnicode,
} CREmoticonType;

@interface CRInputEmoticon : NSObject
@property (nonatomic,readonly)  CREmoticonType type;
@property (nonatomic,strong)    NSString    *emoticonID;
@property (nonatomic,strong)    NSString    *tag;
@property (nonatomic,strong)    NSString    *filename;
@property (nonatomic,copy)      NSString    *unicode;
@end

@interface CRInputEmoticonLayout : NSObject
@property (nonatomic, assign) NSInteger rows;               //行数
@property (nonatomic, assign) NSInteger columes;            //列数
@property (nonatomic, assign) NSInteger itemCountInPage;    //每页显示几项
@property (nonatomic, assign) CGFloat   cellWidth;          //单个单元格宽
@property (nonatomic, assign) CGFloat   cellHeight;         //单个单元格高
@property (nonatomic, assign) CGFloat   imageWidth;         //显示图片的宽
@property (nonatomic, assign) CGFloat   imageHeight;        //显示图片的高
@property (nonatomic, assign) BOOL      emoji;

- (id)initEmojiLayout:(CGFloat)width;

- (id)initCharletLayout:(CGFloat)width;

@end

@interface CRInputEmoticonCatalog : NSObject
@property (nonatomic,strong)    CRInputEmoticonLayout *layout;
@property (nonatomic,strong)    NSString        *catalogID;
@property (nonatomic,strong)    NSString        *title;
@property (nonatomic,strong)    NSDictionary    *id2Emoticons;
@property (nonatomic,strong)    NSDictionary    *tag2Emoticons;
@property (nonatomic,strong)    NSArray         *emoticons;
@property (nonatomic,strong)    NSString        *icon;             //图标
@property (nonatomic,strong)    NSString        *iconPressed;      //小图标按下效果
@property (nonatomic,assign)    NSInteger       pagesCount;        //分页数
@end

@interface CRInputEmoticonManager : NSObject

+ (instancetype)sharedManager;

- (void)start;

- (CRInputEmoticonCatalog *)emoticonCatalog:(NSString *)catalogID;
- (CRInputEmoticon *)emoticonByTag:(NSString *)tag;
- (CRInputEmoticon *)emoticonByID:(NSString *)emoticonID;
- (CRInputEmoticon *)emoticonByCatalogID:(NSString *)catalogID
                           emoticonID:(NSString *)emoticonID;

@end
